package com.j3a.journal.model;

// Generated 21 oct. 2014 14:53:50 by Hibernate Tools 4.0.0

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * JournalisteJournal generated by hbm2java
 */
@Entity
@Table( name = "journaliste_journal"
        , catalog = "journal" )
public class JournalisteJournal implements java.io.Serializable {

    /**
     * 
     */
    private static final long    serialVersionUID = 1L;
    private JournalisteJournalId id;
    private Journal              journal;
    private Journaliste          journaliste;
    private Date                 jrlteJnalDate;

    public JournalisteJournal() {
    }

    public JournalisteJournal( JournalisteJournalId id, Journal journal, Journaliste journaliste ) {
        this.id = id;
        this.journal = journal;
        this.journaliste = journaliste;
    }

    public JournalisteJournal( JournalisteJournalId id, Journal journal, Journaliste journaliste, Date jrlteJnalDate ) {
        this.id = id;
        this.journal = journal;
        this.journaliste = journaliste;
        this.jrlteJnalDate = jrlteJnalDate;
    }

    @EmbeddedId
    @AttributeOverrides( {
            @AttributeOverride( name = "journalisteId", column = @Column( name = "JOURNALISTE_ID", nullable = false, length = 30 ) ),
            @AttributeOverride( name = "journalId", column = @Column( name = "JOURNAL_ID", nullable = false, length = 30 ) ) } )
    public JournalisteJournalId getId() {
        return this.id;
    }

    public void setId( JournalisteJournalId id ) {
        this.id = id;
    }

    @ManyToOne( fetch = FetchType.LAZY )
    @JoinColumn( name = "JOURNAL_ID", nullable = false, insertable = false, updatable = false )
    public Journal getJournal() {
        return this.journal;
    }

    public void setJournal( Journal journal ) {
        this.journal = journal;
    }

    @ManyToOne( fetch = FetchType.LAZY )
    @JoinColumn( name = "JOURNALISTE_ID", nullable = false, insertable = false, updatable = false )
    public Journaliste getJournaliste() {
        return this.journaliste;
    }

    public void setJournaliste( Journaliste journaliste ) {
        this.journaliste = journaliste;
    }

    @Temporal( TemporalType.DATE )
    @Column( name = "JRLTE_JNAL_DATE", length = 10 )
    public Date getJrlteJnalDate() {
        return this.jrlteJnalDate;
    }

    public void setJrlteJnalDate( Date jrlteJnalDate ) {
        this.jrlteJnalDate = jrlteJnalDate;
    }

}
